let arr = [2,4,7,3,1,6,5]

function insertSort(arr){
    const len =arr.length
    let target
    for(let i =1;i<len;i++){
        target = arr[i]
        let j =i
    while(target<arr[j-1]){
        arr[j]=arr[j-1]
        j--
    }
    arr[j] = target
}
return arr
}
console.log(insertSort(arr));
